/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * NextPrevPanel.java
 *
 * Created on 2011-05-18, 15:16:57
 */

package view;

import java.awt.event.ActionListener;

/**
 *
 * @author borysfan
 */
public class NextPrevPanel extends javax.swing.JPanel {

    /** Creates new form NextPrevPanel */
    public NextPrevPanel() {
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        prevBtn = new javax.swing.JButton();
        nextBtn = new javax.swing.JButton();
        closeBtn = new javax.swing.JButton();

        prevBtn.setText("<< poprzedni krok");
        prevBtn.setToolTipText("wróć do poprzedniego kroku");

        nextBtn.setText("następny krok >>");
        nextBtn.setToolTipText("szukaj kolejnego węzła w ścieżce");

        closeBtn.setText("X");
        closeBtn.setToolTipText("Zakończ tryb 'krok po kroku'");
        closeBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                closeBtnActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(prevBtn)
                .addGap(26, 26, 26)
                .addComponent(nextBtn)
                .addGap(18, 18, 18)
                .addComponent(closeBtn)
                .addContainerGap(77, Short.MAX_VALUE))
        );

        layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {nextBtn, prevBtn});

        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(nextBtn, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(closeBtn))
                    .addComponent(prevBtn, javax.swing.GroupLayout.Alignment.LEADING))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
    }// </editor-fold>//GEN-END:initComponents

    private void closeBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_closeBtnActionPerformed
       
    }//GEN-LAST:event_closeBtnActionPerformed


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton closeBtn;
    private javax.swing.JButton nextBtn;
    private javax.swing.JButton prevBtn;
    // End of variables declaration//GEN-END:variables

    public void addNextBtnAction(ActionListener action){
        nextBtn.addActionListener(action);
    }

    public void addPrevBtnAction(ActionListener action){
        prevBtn.addActionListener(action);
    }

    public void addCloseBtnAction(ActionListener action){
        closeBtn.addActionListener(action);
    }

    public void setVisibleNextBtn(boolean value){
        nextBtn.setVisible(value);
    }

    public void setVisiblePrevBtn(boolean value){
        prevBtn.setVisible(value);

    }
}
